package com.stx.yuanhui;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.ObjectInputStream;

public class ObjectReader {
    public static void main(String[] args) {
        String path = "E:\\2025\\双体\\作业\\4-6-parts\\work\\part_three\\1组作业\\yuanhui\\student.txt";

        try (FileInputStream fis = new FileInputStream(path);
             ObjectInputStream ois = new ObjectInputStream(fis)) {
            Person p = (Person) ois.readObject();
            System.out.println("反序列化结果：");
            System.out.println(p);
        } catch (IOException | ClassNotFoundException e) {
            e.printStackTrace();
        }
    }
}
